$(function () {
    $.get(Feng.ctxPath + "/consultant/getDoctor", function (data) {
        var txt = '';
        for(var i=0;i<data.length;i++){
            txt += '<div style="width: 20%"><span class="checkboxStyle">' +
                '<input class="checkboxClass" type="radio" name="about" value="' + data[i].doctor + '" id="click_' + data[i].doctor + '"></span>' +
                '<label class="labelStyle" for="click_' + data[i].doctor + '" style="font-weight: 500;margin-left: 10px;">' + data[i].doctor + '</label></div>'
        }
        document.getElementById('doctorBox').innerHTML = txt;
    }, "json");
});
$("#doctorBox").on('click', '.checkboxStyle', function () {
    $(this).children().attr('checked','true');
    $(this).addClass('selection').parent().siblings().children('.checkboxStyle').removeClass('selection');
});
$("#submission").click(function () {
    var id = $("#id").val();
    var doctor = $("input[name='about']:checked").val();
    if(doctor == "" || doctor == null){
        alert("请选择一个医生！")
        return;
    }
    var remarks = $("#remarks").val();
    $.ajax({
        url: Feng.ctxPath +"/customer/updateDoctorOrthodontics",
        type:'POST',
        data:{
            id:id,
            remarks:remarks,
            doctor:doctor
        },
        success:function (data) {
            Feng.success("保存成功!");
            window.parent.orthodonticsDetail.table.refresh();
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        },
        error:function (data) {alert("没有权限，请联系系统管理员！");}
    })
})